<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<!--#include file="lib/saferequest.asp"-->
<%
cph=saferequest("cph",0)
cl_lat=saferequest("lat",1)
cl_lng=saferequest("lng",1)
cl_timestamp=saferequest("timestamp",1)
cl_speed=saferequest("speed",1)
cl_reverse=saferequest("reverse",0)

set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from cl where cph='"&cph&"'"
rs.open sql,conn,1,1
'response.write(sql)
'do while not rs.eof
	
'	rs.movenext
'loop
if not rs.eof then
	'if not (cdbl(cl_lat)=cdbl(rs("cl_lat")) and  cdbl(cl_lng)=cdbl(rs("cl_lng"))) then
		
		
	
	
		set cmd=server.CreateObject ("adodb.command")
		set cmd.ActiveConnection =conn
		sql="update cl set cl_lat="&cl_lat&",cl_lng="&cl_lng&",cl_timestamp="&cl_timestamp&",cl_speed="&cl_speed&",cl_reverse='"&cl_reverse&"',cl_update='"&now()&"' where cph='"&cph&"'"
		cmd.CommandText =sql
		cmd.Execute
	
	'end if

	
end if


	
rs.close
set rs=nothing
conn.close
set conn=nothing

%>

